package com.itheima03.mapper;

import com.itheima03.bean.Student;
import com.itheima03.sql.ReturnSql;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface StudentMapper {
    //    @Select("select * from student")
    @SelectProvider(type = ReturnSql.class, method = "getSelectAll")
    List<Student> selectAll();

    //    @Delete("DELETE FROM student WHERE id=#{id}")
    @DeleteProvider(type = ReturnSql.class, method = "getDelete")
     Integer delete(Integer id);


    //    @Insert("Insert into student values(#{id},#{name},#{age})")
    @InsertProvider(type = ReturnSql.class, method = "getInsert")
    Integer insert(Student stu);


    //    @Update("UPDATE student SET name=#{name},age=#{age} WHERE id=#{id}")
    @UpdateProvider(type = ReturnSql.class,method = "getUpdate")
    Integer update(Student stu);


}
